import Layout from '@/components/layout/Layout'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('../_import.' + process.env.NODE_ENV)

// const meta = { auth: true, cache: true }
const meta = { auth: true }

export default {
  path: '/',
  name: 'Home',
  meta,
  redirect: { name: 'Home' },
  component: Layout,
  children: (pre => [
    {
      path: 'home',
      name: `${pre}`,
      component: _import('home/Home'),
      meta: {
        ...meta,
        title: '首页'
      }
    }
  ])('Home')
}
